<template>
  <div class="xbx disk">
    <div class="inner">
      <a href="javascript:;" class="pro">&nbsp;</a>
      <div class="roll">
        <ul>
          <li v-for="(item, index) in NewdieList" :key="index">
            <div>
              <img
                width="100"
                :src="item.picUrl"
                alt=""
              />
            </div>
            <p class="p1">
              <a href="javascript:;">{{item.name}}</a>
            </p>
            <p class="p2"><a href="javascript:;">{{item.artist.name}}</a></p>
          </li>
        </ul>
      </div>
      <a href="javascript:;" class="next">&nbsp;</a>
    </div>
  </div>
</template>

<script>
import { NewalbumApi } from "@/request/api";
export default {
  data() {
    return {
      // 新碟上架列表
      NewdieList: [],
    };
  },
  created() {
    NewalbumApi().then((res) => {
      // console.log(res);
      if (res.data.code === 200) {
        this.NewdieList = res.data.albums.slice(0, 10);
      }
    });
  },
};
</script>
 
<style lang = "less" scoped>
@import "../../assets/base.less";
.disk {
  width: 689px;
  position: relative;
  box-sizing: border-box;
  height: 186px;
  margin: 20px 0 37px;
  border: 1px solid #d3d3d3;
  .inner {
    height: 184px;
    padding-left: 16px;
    background: #f5f5f5;
    border: 1px solid #fff;
    a {
      background: url("../../assets/images/index.png") no-repeat 0 0;
      &.pro {
        position: absolute;
        top: 71px;
        left: 0px;
        width: 17px;
        height: 17px;
        background-position: -260px -75px;
      }
      &.next {
        position: absolute;
        top: 71px;
        width: 17px;
        height: 17px;
        background-position: -300px -75px;
      }
    }
    .roll {
      display: inline-block;
      width: 645px;
      height: 180px;
      overflow: hidden;
      /* border: 1px solid #000; */
      ul {
        width: 690px;
        margin: 28px 0 0 0;
        display: flex;
        li {
          width: 118px;
          height: 150px;
          margin-left: 11px;
          background: url("../../assets/images/index.png") no-repeat 0 0;
          background-position: -260px 100px;
          p {
            width: 90%;
            line-height: 18px;
            a {
              color: #000;
            }
            &.p1 {
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
              word-wrap: normal;
            }
          }
        }
      }
    }
  }
}
</style>